// This will avoid problems if the VariableHolder is not yet initialized.
if (isnil "d_mission_functions_compiled") then {
	call compile PreProcessFileLineNumbers "base\mission\mission_functions.sqf";
};
waituntil{!(isNil "JIPH") AND !(isNil "d_mission_functions_compiled")};
if (d_mission_debug_messages) then { diag_log Format["(%1)[%2]: %3: %4",diag_tickTime,"mission_init.sqf","Starting initialization!"]; };

If (X_Client) then {
	nul = player call XfMissionInitializeObjects;
	player spawn XfMissionLoadPlayerActions;
	player spawn XfMissionLoadTasks;
	player spawn XfMissionLoadMarkers;
	player addEventHandler ["killed", XfMissionPlayerKilled];
};
If (X_Server) then {
	if (isnil "DM_Mission_Server_Initialized") then {
		DM_Mission_Server_Initialized = True;
		// This will store all objects picked up by a player
		["mission_pickedup_objects",[]] call XNetSetJIP;
		waituntil {sleep 0.05; !isnil "KRON_UPS_sharedist"};
		DM_Mission_UPSMON_Share_Dist = KRON_UPS_sharedist;
		diag_log Format["     <[]>---- Mission Framework Loaded ----<[]>     "];
	};
};
